package weekend4;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class IODemo {
    public static void main(String[] args) throws IOException {
       /* FileOutputStream fos=new FileOutputStream("LeoMessi.txt");
        OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        BufferedWriter bw=new BufferedWriter(osw);
        PrintWriter pw=new PrintWriter(bw,true);
        String line="胡子一刮，里奥十八";
        pw.println(line);
        System.out.println("写入成功");
        pw.close();

        */

        FileInputStream fis=new FileInputStream("LeoMessi.txt");
        FileOutputStream fos=new FileOutputStream("PSG.txt");
        InputStreamReader isr=new InputStreamReader(fis,StandardCharsets.UTF_8);
        OutputStreamWriter osw=new OutputStreamWriter(fos,StandardCharsets.UTF_8);
        BufferedReader br=new BufferedReader(isr);
        BufferedWriter bw=new BufferedWriter(osw);
        PrintWriter pw=new PrintWriter(bw,true);
        String line;
        while((line=br.readLine())!=null){
            pw.println(line);
        }
        pw.close();
        br.close();
    }
}

